define(function (required, exports, modules) {
  var modal = require('mods/modal')
  exports.cal_index = function () {
    $("._del").click(function () {
      var _csrf = $("#csrf").val()
      var cal_id = $(this).attr('data-id');

      modal.confirm("确定要删除此信息吗?", {}, function () {
        $.ajax({
          url: '/admin/calendar/ops',
          type: 'POST',
          dataType: "json",
          data: {
            cal_id: cal_id,
            _csrf: _csrf
          },
          success: function (res) {
            if (res.code == 200) {
              modal.msg(res.msg, {}, function () {
                location.reload()
              })
            } else {
              modal.alert(res.msg)
              return false
            }
          }
        })
      }, function () {
      })
    })
  }
})